package com.nervenets.shopping.hibernate.domain.common;

import com.nervenets.general.hibernate.DomainObject;
import com.nervenets.shopping.adapter.jsonType.GlobalRuleSettingJson;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Type;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * 全局规则设置
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class GlobalRule extends DomainObject {
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "是否启用")
    private boolean enable;
    @ApiModelProperty(value = "设置明细")
    @Builder.Default
    @Type(type = GlobalRuleSettingJson.NAME)
    @Column(columnDefinition = "json")
    private GlobalRuleSetting setting = new GlobalRuleSetting();
}
